//
//  SketchParse.h
//  SketchParse
//
//  Created by gao on 2017/10/11.
//  Copyright © 2017年 gao. All rights reserved.
//
#define RGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//RGB color macro with alpha
#define RGBWithAlpha(rgbValue,a) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface SketchParse : NSObject
/**
 *  创建 UIImage
 *
 *  @param fileName 图片文件名
 *
 *  @return UIImage
 */
+(id)createUIImage:(NSString *)fileName;

/**
 *  创建 UIImageView
 *
 *  @param fileName 图片文件名
 *  @param rect     图片显示区域
 *
 *  @return UIImageView
 */
+(id)createUIImageView:(NSString *)fileName frame:(CGRect)rect;


/**
 *  创建 UIImageView    图片
 *
 *  @param fileName    图片文件名
 *  @param centerPoint 图片中心点
 *  @param size        图片大小
 *  @param tag         tag
 *
 *  @return UIImageView
 */
+(id)createUIImageView:(NSString *)fileName centerPoint:(CGPoint)centerPoint size:(CGSize)size tag:(int)tag;




/**
 *  创建图片按钮
 *
 *  @param fileName    按钮正常图片
 *  @param point       按钮中心点坐标
 *  @param size        按钮大小
 *  @param selecded    按钮选中图片
 *  @param disabled    按钮禁用图片
 *  @param Highlighted 按钮高亮图片
 *  @param target      target
 *  @param event       event
 *  @param tag         tag
 *
 *  @return UIButton
 */
+(id)createUIButton:(NSString *)fileName centerPoint:(CGPoint)point size:(CGSize)size selected:(NSString *)selecded disabled:(NSString *)disabled Highlighted:(NSString *)Highlighted target:(id)target event:(SEL)event tag:(int)tag;

/**
 创建OBShapeButton

 @param fileName
 @param point
 @param size
 @param selecded
 @param disabled
 @param Highlighted
 @param target
 @param event
 @param tag
 @return
 */
+(id)createOBShapeButton:(NSString *)fileName centerPoint:(CGPoint)point size:(CGSize)size selected:(NSString *)selecded disabled:(NSString *)disabled Highlighted:(NSString *)Highlighted target:(id)target event:(SEL)event tag:(int)tag;

/**
 创建文字按钮

 @param text 按钮文本
 @param centerPoint 中心点
 @param size 尺寸
 @param font 字体
 @param textColor 正常状态文字颜色
 @param highlightedTextColor 高亮状态文字颜色
 @param selectedTextColor 选中状态文字颜色
 @param target target
 @param event 时间
 @param tag tag
 @return UIButton
 */
+(id)createUIButton:(NSString *)text centerPoint:(CGPoint)centerPoint size:(CGSize)size font:(UIFont *)font textColor:(UIColor *)textColor highlightedTextColor:(UIColor *)highlightedTextColor selectedTextColor:(UIColor *)selectedTextColor target:(id)target event:(SEL)event tag:(int)tag;
//
/**
 *  创建 UILabel
 *
 *  @param text            Label 文字
 *  @param rect            Label 区域
 *  @param font            Label 字体
 *  @param textColor       Label 字体颜色
 *  @param backgroundColor Label 背景色
 *  @param textAlignment   Label 文字对齐方式
 *  @param tag             Label tag
 *
 *  @return UILabel
 */
+(id)createUILabel:(NSString *)text frame:(CGRect)rect font:(UIFont *)font textColor:(UIColor*)textColor backgroundColor:(UIColor *)backgroundColor textAlignment:(NSTextAlignment)textAlignment tag:(int)tag;

/**
 *  创建 UITextField
 *
 *  @param placeholder     placehoder
 *  @param x               TextField x
 *  @param width           TextField width
 *  @param height          TextField height
 *  @param centerPointY    TextField centerPointY
 *  @param font            TextField 字体
 *  @param textColor       TextField 字体颜色
 *  @param backgroundColor TextField 背景颜色
 *  @param borderStyle     TextField 边框样式
 *  @param delegate        delegate
 *  @param tag             tag
 *
 *  @return UITextField
 */
+(id)createUITextField:(NSString *)placeholder x:(float)x width:(float)width height:(float)height centerPointY:(float)centerPointY font:(UIFont*)font textColor:(UIColor *)textColor backgroundColor:(UIColor *)backgroundColor borderStyle:(UITextBorderStyle )borderStyle delegate:(id)delegate tag:(int)tag;


/**
 *  创建 UIView
 *
 *  @param rect            View 区域大小
 *  @param backgroundColor View 背景色
 *  @param cornerRadius    View 圆角
 *  @param tag             tag
 *
 *  @return UIView
 */
+(id)createUIViewWithFrame:(CGRect)rect backgroundColor:(UIColor *)backgroundColor cornerRadius:(int)cornerRadius borderColor:(UIColor*)borderColor borderWidth:(int)borderWidth tag:(int)tag;



@end
